<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name',32)->comment('名字');
            $table->string('username',32)->comment('账号');
            $table->string('password')->comment('密码');
            $table->string('address')->default('空')->comment('住址');
            $table->char("phone",11)->default('0');
            $table->unsignedInteger('admin_id')->default('0')->comment('操作者id');
            $table->rememberToken()->comment('登陆验证 token 字段');
            $table->softDeletes()->comment('软删除字段');
            $table->unique('username');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admins');
    }
}
